<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Livraria</title>
</h:head>

<h:body>
	<h:outputStylesheet library="css" name="estilo.css" />

	<div id="header">
		<h1>
			Livraria
			<h:graphicImage value="/resources/images/icons/library.png"
				style="float: right;" />
		</h1>
		<br />
		<br />
	</div>

	<div id="conteudo">
		<h:form>
			<p:tabView>
				<p:tab title="Consulta">
					<p:inputText />
					<p:commandButton value="Buscar" /><br /><br />
					<p:dataGrid var="livro" columns="3" value="#{livroCB.livros}"
						rows="12" paginator="true"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">

     					<p:panel header="#{livro.nome}" style="text-align:center">
     						<h:panelGrid>
     							<h:outputLabel value="#{livro.autor}" />
     						</h:panelGrid>
     					</p:panel>
					</p:dataGrid>
				</p:tab>

				<p:tab title="Cadastro">
					<h:panelGrid columns="2">
						<h:outputLabel value="Nome:" />
						<p:inputText value="#{livroCB.livro.nome}" />
						<h:outputLabel value="Gênero:" />
						<p:inputText value="#{livroCB.livro.genero}" />
						<h:outputLabel value="Qtde. Pág.:" />
						<p:inputText value="#{livroCB.livro.qtdePaginas}" />
						<h:outputLabel value="Ano:" />
						<p:inputText value="#{livroCB.livro.ano}" />
						<h:outputLabel value="Autor:" />
						<p:inputText value="#{livroCB.livro.autor}" />
					</h:panelGrid>
					<p:commandButton value="Salvar"
						actionListener="#{livroCB.adiciona}" />
					<p:commandButton value="Limpar" />
				</p:tab>
			</p:tabView>
		</h:form>
	</div>

	<div id="footer">
		<hr />
		&copy; 2012 Livraria.
	</div>

</h:body>

</html>